8370493: [ubsan] aotMapLogger.cpp:864:44: runtime error: applying non-zero offset NNNNN to null pointer - #32057
8370493: [ubsan] aotMapLogger.cpp:864:44: runtime error: applying non-zero offset NNNNN to null pointer#32057matias9927 wants to merge 1 commit into
Conversation
…-zero offset NNNNN to null pointer
|
👋 Welcome back matsaave! A progress list of the required criteria for merging this PR into |
|
@matias9927 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 89 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@matias9927 The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
dholmes-ora
left a comment
There was a problem hiding this comment.
Seems a reasonable workaround. Thanks.
offamitkumar
left a comment
There was a problem hiding this comment.
I would have updated two more location with address + offset, but current changes are also fine by me.
diff --git a/src/hotspot/share/cds/archiveBuilder.cpp b/src/hotspot/share/cds/archiveBuilder.cpp
index 0b046a527cd..17ab60b465d 100644
--- a/src/hotspot/share/cds/archiveBuilder.cpp
+++ b/src/hotspot/share/cds/archiveBuilder.cpp
@@ -1049,7 +1049,7 @@ class RelocateBufferToRequested : public BitMapClosure {
address bottom = _builder->buffer_bottom();
address top = _builder->buffer_top();
address new_bottom = ArchiveUtils::offset_to_requested_addr(bottom, _buffer_to_requested_delta);
- address new_top = top + _buffer_to_requested_delta;
+ address new_top = ArchiveUtils::offset_to_requested_addr(top, _buffer_to_requested_delta);
aot_log_debug(aot)("Relocating archive from [" INTPTR_FORMAT " - " INTPTR_FORMAT "] to "
"[" INTPTR_FORMAT " - " INTPTR_FORMAT "]",
p2i(bottom), p2i(top),
@@ -1114,7 +1114,7 @@ void ArchiveBuilder::relocate_to_requested() {
patcher.doit();
} else {
assert(CDSConfig::is_dumping_dynamic_archive(), "must be");
- _requested_dynamic_archive_top = _requested_dynamic_archive_bottom + my_archive_size;
+ _requested_dynamic_archive_top = ArchiveUtils::offset_to_requested_addr(_requested_dynamic_archive_bottom, my_archive_size);
RelocateBufferToRequested<false> patcher(this);
patcher.doit();
}
The UBSAN tool found undefined behavior in the aotMapLogger which relates to JDK-8366062. This patch applies an updated fix for both issues that places
address + offsetcalculations in archiveUtils with proper casting to avoid the UBSAN error. Verified with tier 1-5 tests.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32057/head:pull/32057$ git checkout pull/32057Update a local copy of the PR:
$ git checkout pull/32057$ git pull https://git.openjdk.org/jdk.git pull/32057/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32057View PR using the GUI difftool:
$ git pr show -t 32057Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32057.diff
Using Webrev
Link to Webrev Comment